package util;

/**
 *
 */
public class StopWatch {
    private long startTime;
    private long duration;
    private boolean recording;

    public void start() {
        startTime = System.nanoTime();
        recording = true;
    }

    public void stop() {
        duration = System.nanoTime() - startTime;
        recording = false;
    }

    public boolean isRecording() {
        return recording;
    }

    public long getDurationInMillis() {
        return duration / 1000000;
    }
}

